package org.btik.lightweb.client;

import org.btik.light.meta.DevMo;
import org.btik.light.meta.LightNode;
import org.btik.light.server.platform.common.api.service.OperationServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;

/**
 * @author lustre
 * @since 2023/1/13 0:56
 */
@RestController
@RequestMapping("/camera")
public class CameraManageController {
    @Autowired
    private OperationServer manageServer;
    @RequestMapping("/list")
    public Collection<DevMo> list(String node) {
        if (ObjectUtils.isEmpty(node)) {
            node = LightNode.ROOT;
        }
        return manageServer.listCameraAtNode(node);
    }
}
